package com.example.wangfanwangluo.wangfanboss;

import android.content.Intent;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;

public class Kefu extends AppCompatActivity {
    private Typeface iconfont;
    private TextView exitbtn;
    private TextView imagetv;
    private Button phonebtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_kefu);
        ActionBar actionbar = getSupportActionBar();
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        if (actionbar != null){
            actionbar.hide();
        }
        initViews();
    }
    //初始化ui
    public void initViews(){
        iconfont = Typeface.createFromAsset(getAssets(), "iconfont/iconfont.ttf");
        exitbtn = (TextView)findViewById(R.id.exitbtn_kefu);
        exitbtn.setTypeface(iconfont);
        imagetv = (TextView)findViewById(R.id.kefuimage_kufu);
        imagetv.setTypeface(iconfont);
        phonebtn = (Button)findViewById(R.id.phonebtn_kefu);
        exitbtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //回到上级页面,结束当前活动
                finish();
            }
        });
        phonebtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //拨打电话
                //用intent启动拨打电话
                Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:"+"022-60760091"));
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                startActivity(intent);
            }
        });


    }
}
